package com.bdqn.service.impl;

import com.bdqn.mapper.AccountMapper;
import com.bdqn.pojo.Account;
import com.bdqn.service.AccountService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * AccountServiceImpl
 *
 * @author 武子
 * @date 2024/10/31
 */
@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountMapper accountMapper;

    /**
     * @param cardno
     * @param password
     * @return
     */
    @Override
    public Account login(String cardno, String password) {
        return accountMapper.login(cardno,password);
    }

    /**
     * @param cardno
     * @return
     */
    @Override
    public Account income(String cardno) {
        return accountMapper.income(cardno);
    }

    /**
     * @param cardno
     * @param con
     * @return
     */
    @Override
    public int consumption(String cardno, double con) {
        return accountMapper.consumption(cardno,con);
    }

    /**
     * @param cardno
     * @param inc
     * @return
     */
    @Override
    public int deposit(String cardno, double inc) {
        return accountMapper.deposit(cardno,inc);
    }
}
